<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <!-- métas -->
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <!-- css -->
    <link rel="stylesheet" type="text/css" href="<?=BASEURL.CSS_DIR?>style_edit.css" media="screen"/>
    <link rel="stylesheet" type="text/css" href="<?=BASEURL.CSS_DIR?>popin.css" media="screen"/>
    <!-- javascript -->
    <script type="text/javascript" src="<?=BASEURL.JS_DIR?>jquery.js" ></script>
    <script type="text/javascript" src="<?=BASEURL.JS_DIR?>jquery_std.js" ></script>
    <script type="text/javascript" src="<?=BASEURL.JS_DIR?>common.js" ></script>
    <script type="text/javascript" src="<?=BASEURL.JS_DIR?>popin.js" ></script>
    <script type="text/javascript" src="<?=BASEURL.JS_DIR?>barreOutils.js" ></script>
    <script type="text/javascript" src="<?=BASEURL.JS_DIR?>action_edit.js" ></script>
    <script type="text/javascript">
    
    <?=@$inlineJavascript;?>
    function insertInCode() {

      var linktype=$("input[@type='radio']:checked").val();
      
      switch (linktype)
        {
          case 'wikipage':
            link=$('#wikipage option:selected').val();
            break;
          case 'webadress':
            link=$('#webadress').val();
            break;
          case 'file':
            link=$('#filelist option:selected').val();
            break;
          case 'email':
            link='mailto:'+$('#emailadress').val();
            break;
        }
       var descr=$("#texttodisplay").val();
       if (descr!="") descr="|"+descr;
       window.parent.tb_replaceSelection('[['+link+descr+']]',window.parent.document.myForm.content);
    }
     $(document).ready(function() {
    $("input[@type='radio']").click(function(){
        $("tr").removeClass("selected");
        $(this).parent('td').parent('tr').addClass("selected")
        });
        $("#texttodisplay").val(window.parent.tb_getSelection(window.parent.document.myForm.content));
        
      });
    </script>
    <style>
    .mywidth { width:230px;}
    table {  border-collapse: collapse ;}
    tr { height:30px;}
    </style>
  </head>
  <body style="margin:0 10px;">
<table>
<tr>
    <td width="150" height="60">Text to display</td>
    <td>
         <input type="text" value="description" id="texttodisplay" class="mywidth" />
    </td>
</tr>
<tr class="selected">
    <td><input type="radio" name="group1" value="wikipage" checked>&nbsp;&nbsp;Wiki page</td>
    <td>
        <select id="wikipage" name="selectPage" class="mywidth">
          <?foreach ($this->wiki_model->getAllPages() as $page):?>
            <option value ="<?=$page?>" ><?=$page?></option>
          <?endforeach;?>
        </select>    
    </td>
</tr>
<tr>
    <td><input type="radio" name="group1" value="webadress">&nbsp;&nbsp;Web adress</td>
    <td><input type="text" value="http://" id="webadress" class="mywidth"/></td>
</tr>
<tr>
    <td><input type="radio" name="group1" value="file">&nbsp;&nbsp;Internal file</td>
    <td>
        <select id="filelist" class="mywidth">
          <?foreach ($files as $file):?>
            <option value ="<?=$file?>" ><?=$file?></option>
          <?endforeach;?>
        </select>
    </td>
</tr>
<tr>
    <td><input type="radio" name="group1" value="email">&nbsp;&nbsp;Email adress</td>
    <td><input type="text" value="name@" id="emailadress" class="mywidth" /></td>
</tr>
<tr height="60">
    <td></td>
    <td><input type="button" value="Insérer"   onclick="insertInCode();window.parent.closePopIn();">
<input type="button" value="Annuler"   onclick="window.parent.closePopIn();"></td>
</tr>
</table>
  </body>
</html>
